<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<meta charset="utf-8"/>
	<title>MultiMarkdown v6 Development Notes</title>
	<meta name="author" content="Fletcher T. Penney"/>
	<meta name="date" content="2023-06-10"/>
	<meta name="uuid" content="dd2d8e76-dc2d-416d-9acd-5395d20871c2"/>
</head>
<body>

<h3 id="introduction">Introduction</h3>

<p>This document includes some notes on the development of MultiMarkdown (<abbr title="MultiMarkdown">MMD</abbr>) v6. Most of it
will be interesting only to other developers or those needing to choose the
absolute &#8220;best&#8221; Markdown (<abbr title="Markdown">MD</abbr>) implementation for their needs &#8211; it is not required
reading to understand how the software works.</p>

<h4 id="whyanewversion">Why a New Version?</h4>

<p>MultiMarkdown version 5 was released in November of 2015, but the codebase was
essentially the same as that of v4 &#8211; and that was released in beta in April
of 2013. A few key things prompted work on a new version:</p>

<ul>
<li><p>Accuracy &#8211; <abbr title="MultiMarkdown">MMD</abbr> v4 and v5 were the most accurate versions yet, and a lot of
effort went into finding and resolving various edge cases. However, it began
to feel like a game of whack-a-mole where new bugs would creep in every time I
fixed an old one. The <a href="#gn:1" id="gnref:1" title="see glossary" class="glossary">PEG</a> began to feel rather convoluted in spots, even
though it did allow for a precise (if not always accurate) specification of
the grammar.</p></li>
<li><p>Performance &#8211; &#8220;Back in the day&#8221; <a href="https://github.com/jgm/peg-markdown">peg-markdown</a> was one of the fastest
Markdown parsers around. <abbr title="MultiMarkdown">MMD</abbr> v3 was based on peg-markdown, and would leap-
frog with it in terms of performance. Then <a href="http://commonmark.org/">CommonMark</a> was released, which
was a bit faster. Then a couple of years went by and CommonMark became <em>much</em>
faster &#8211; in one of my test suites, <abbr title="MultiMarkdown">MMD</abbr> v 5.4.0 takes about 25 times longer to
process a long document than CommonMark 0.27.0.</p></li>
</ul>

<p>In the spring of 2016, I decided I wanted to rewrite MultiMarkdown from scratch,
building the parser myself rather than relying on a pre-rolled solution. (I
had been using <a href="https://github.com/ooc-lang/greg">greg</a> to compile the PEG
into parser code. It worked well overall, but lacked some features I needed,
requiring a lot of workarounds.)</p>

<h3 id="firstattempt">First Attempt</h3>

<p>My first attempt started by hand-crafting a parser that scanned through the
document a line at a time, deciding what to do with each line as it found
them. I used regex parsers made with <a href="http://re2c.org/index.html">re2c</a> to
help classify each line, and then a separate parser layer to process groups of
lines into blocks. Initially this approach worked well, and was really
efficient. But I quickly began to code my way into a dead-end &#8211; the strategy
was not elegant enough to handle things like nested lists, etc.</p>

<p>One thing that did turn out well from the first attempt, however, was an
approach for handling <code>&lt;emph&gt;</code> and <code>&lt;strong&gt;</code> parsing. I&#8217;ve learned over the
years that this can be one of the hardest parts of coding accurately for
Markdown. There are many examples that are obvious to a person, but difficult
to properly &#8220;explain&#8221; how to parse to a computer.</p>

<p>No solution is perfect, but I developed an approach that seems to accurately
handle a wide range of situations without a great deal of complexity:</p>

<ol>
<li><p>Scan the documents for asterisks (<code>*</code>). Each one will be handled one at a
time.</p></li>
<li><p>Unlike brackets (<code>[</code> and <code>]</code>), an asterisk is &#8220;ambidextrous&#8221;, in that it
may be able to open a matched pair of asterisks, close a pair, or both. For
example, in <code>foo *bar* foo</code>:</p>

<ol>
<li><p>The first asterisk can open a pair, but not close one.</p></li>
<li><p>The second asterisk can close a pair, but not open one.</p></li>
</ol></li>
<li><p>So, once the asterisks have been identified, each has to be examined to
determine whether it can open/close/both. The algorithm is not that complex,
but I&#8217;ll describe it in general terms. Check the code for more specifics.
This approach seems to work, but might still need some slight tweaking. In
the future, I&#8217;ll codify this better in language rather than just in code.</p>

<ol>
<li><p>If there is whitespace to the left of an asterisk, it can&#8217;t close.</p></li>
<li><p>If there is whitespace or punctuation to the right it can&#8217;t open.</p></li>
<li><p>&#8220;Runs&#8221; of asterisks, e.g. <code>**bar</code> are treated as a unit in terms of
looking left/right.</p></li>
<li><p>Asterisks inside a word are a bit trickier &#8211; we look at the number of
asterisks before the word, the number in the current run, and the number
of asterisks after the word to determine which combinations, if any, are
permitted.</p></li>
</ol></li>
<li><p>Once all asterisks have been tagged as able to open/close/both, we proceed
through them in order:</p>

<ol>
<li><p>When we encounter a tag that can close, we look to see if there is a
previous opener that has not been paired off. If so, pair the two and
remove the opener from the list of available asterisks.</p></li>
<li><p>When we encounter an opener, add it to the stack of available openers.</p></li>
<li><p>When encounter an asterisk that can do both, see if it can close an
existing opener. If not, then add it to the stack.</p></li>
</ol></li>
<li><p>After all tokens in the block have been paired, then we look for nesting
pairs of asterisks in order to create <code>&lt;emph&gt;</code> and <code>&lt;strong&gt;</code> sets. For
example, assume we have six asterisks wrapped around a word, three in front,
and three after. The asterisks are indicated with numbers: <code>123foo456</code>. We
proceed in the following manner:</p>

<ol>
<li><p>Based on the pairing algorithm above, these asterisks would be paired as
follows, with matching asterisks sharing numbers &#8211; <code>123foo321</code>.</p></li>
<li><p>Moving forwards, we come to asterisk &#8220;1&#8221;. It is followed by an
asterisk, so we check to see if they should be grouped as a <code>&lt;strong&gt;</code>.
Since the &#8220;1&#8221; asterisks are wrapped immediately outside the &#8220;2&#8221; asterisks,
they are joined together. More than two pairs can&#8217;t be joined, so we now
get the following &#8211; <code>112foo211</code>, where the &#8220;11&#8221; represents the opening
and closing of a <code>&lt;strong&gt;</code>, and the &#8220;2&#8221; represents a <code>&lt;emph&gt;</code>.</p></li>
</ol></li>
<li><p>When matching a pair, any unclosed openers that are on the stack are
removed, preventing pairs from &#8220;crossing&#8221; or &#8220;intersecting&#8221;. Pairs can wrap
around each other, e.g. <code>[(foo)]</code>, but not intersect like <code>[(foo])</code>. In the
second case, the brackets would close, removing the <code>(</code> from the stack.</p></li>
<li><p>This same approach is used in all tokens that are matched in pairs&#8211;
<code>[foo]</code>, <code>(foo)</code>, <code>_foo_</code>, etc. There&#8217;s slightly more to it, but once you
figure out how to assign opening/closing ability, the rest is easy. By using
a stack to track available openers, it can be performed efficiently.</p></li>
</ol>

<p>In my testing, this approach has worked quite well. It handles all the basic
scenarios I&#8217;ve thrown at it, and all of the &#8220;basic&#8221; and &#8220;devious&#8221; edge cases I
have thought of (some of these don&#8217;t necessarily have a &#8220;right&#8221; answer &#8211; but
v6 gives consistency answers that seem as reasonable as any others to me).
There are also three more edge cases I&#8217;ve come up can still stump it, and
ironically they are handled correctly by most implementations. They just
don&#8217;t follow the rules above. I&#8217;ll continue to work on this.</p>

<p>In the end, I scrapped this effort, but kept the lessons learned in the token
pairing algorithm.</p>

<h3 id="secondattempt">Second Attempt</h3>

<p>I tried again this past Fall. This time, I approached the problem with lots
of reading. <em>Lots and lots</em> of reading &#8211; tons of websites, computer science
journal articles, PhD theses, etc. Learned a lot about lexers, and a lot
about parsers, including hand-crafting vs using parser generators. In brief:</p>

<ol>
<li><p>I learned about the <a href="https://en.wikipedia.org/wiki/Aho-Corasick_algorithm">Aho–Corasick algorithm</a>, which is a great way to
efficiently search a string for multiple target strings at once. I used this
to create a custom lexer to identify tokens in a MultiMarkdown text document
(e.g. <code>*</code>, <code>[</code>, <code>{++</code>, etc.). I learned a lot, and had a good time working
out the implementation. This code efficiently allowed me to break a string of
text into the tokens that mattered for Markdown parsing.</p></li>
<li><p>However, in a few instances I really needed some features of regular
expressions to simplify more complex structures. After a quick bit of testing,
using re2c to create a tokenizer was just as efficient, and allowed me to
incorporate some regex functionality that simplified later parsing. I&#8217;ll keep
the Aho-Corasick stuff around, and will probably experiment more with it
later. But I didn&#8217;t need it for <abbr title="MultiMarkdown">MMD</abbr> now. <code>lexer.re</code> contains the source for
the tokenizer.</p></li>
</ol>

<p>I looked long and hard for a way to simplify the parsing algorithm to try and
&#8220;touch&#8221; each token only once. Ideally, the program could step through each
token, and decide when to create a new block, when to pair things together,
etc. But I&#8217;m not convinced it&#8217;s possible. Since Markdown&#8217;s grammar varies
based on context, it seems to work best when handled in distinct phases:</p>

<ol>
<li><p>Tokenize the string to identify key sections of text. This includes line
breaks, allowing the text to be examined one line at time.</p></li>
<li><p>Join series of lines together into blocks, such as paragraphs, code blocks,
lists, etc.</p></li>
<li><p>The tokens inside each block can then be paired together to create more
complex syntax such as links, strong, emphasis, etc.</p></li>
</ol>

<p>To handle the block parsing, I started off using the Aho-Corasick code to
handle my first attempt. I had actually implemented some basic regex
functionality, and used that to group lines together to create blocks. But
this quickly fell apart in the face of more complex structures such as
recursive lists. After a lot of searching, and <em>tons</em> more reading, I
ultimately decided to use a parser generator to handle the task of group lines
into blocks. <code>parser.y</code> has the source for this, and it is processed by the
<a href="http://www.hwaci.com/sw/lemon/">lemon</a> parser generator to create the actual code.</p>

<p>I chose to do this because hand-crafting the block parser would be complex.
The end result would likely be difficult to read and understand, which would
make it difficult to update later on. Using the parser generator allows me to
write things out in a way that can more easily be understood by a person. In
all likelihood, the performance is probably as good as anything I could do
anyway, if not better.</p>

<p>Because lemon is a LALR(1) parser, it does require a bit of thinking ahead
about how to create the grammar used. But so far, it has been able to handle
everything I have thrown at it.</p>

<h3 id="optimization">Optimization</h3>

<p>One of my goals for <abbr title="MultiMarkdown">MMD</abbr> 6 was performance. So I&#8217;ve paid attention to speed
along the way, and have tried to use a few tricks to keep things fast. Here
are some things I&#8217;ve learned along the way. In no particular order:</p>

<h4 id="memoryallocation">Memory Allocation</h4>

<p>When parsing a long document, a <em>lot</em> of token structures are created. Each
one requires a small bit of memory to be allocated. In aggregate, that time
added up and slowed down performance.</p>

<p>After reading for a bit, I ended up coming up with an approach that uses
larger chunks of memory. I allocate pools of of memory in large slabs for
smaller &quot;objects. For example, I allocate memory for 1024 tokens at a
single time, and then dole that memory out as needed. When the slab is empty,
a new one is allocated. This dramatically improved performance.</p>

<p>When pairing tokens, I created a new stack for each block. I realized that an
empty stack didn&#8217;t have any &#8220;leftover&#8221; cruft to interfere with re-use, so I
just used one for the entire document. Again a sizeable improvement in
performance from only allocating one object instead of many. When recursing
to a deeper level, the stack just gets deeper, but earlier levels aren&#8217;t
modified.</p>

<p>Speaking of tokens, I realized that the average document contains a lot of
single spaces (there&#8217;s one between every two words I have written, for
example.) The vast majority of the time, these single spaces have no effect
on the output of Markdown documents. I changed my whitespace token search to
only flag runs of 2 or more spaces, dramatically reducing the number of
tokens. This gives the benefit of needing fewer memory allocations, and also
reduces the number of tokens that need to be processed later on. The only
downside is remember to check for a single space character in a few instances
where it matters.</p>

<h4 id="properinputbuffering">Proper input buffering</h4>

<p>When I first began last spring, I was amazed to see how much time was being
spent by MultiMarkdown simply reading the input file. Then I discovered it
was because I was reading it one character at a time. I switched to using a
buffered read approach and the time to read the file went to almost nothing. I
experimented with different buffer sizes, but they did not seem to make a
measurable difference.</p>

<h4 id="outputbuffering">Output Buffering</h4>

<p>I experimented with different approaches to creating the output after parsing.
I tried printing directly to <code>stdout</code>, and even played with different
buffering settings. None of those seemed to work well, and all were slower
than using the <code>d_string</code> approach (formerly called <code>GString</code> in MMD 5).</p>

<h4 id="fastsearches">Fast Searches</h4>

<p>After getting basic Markdown functionality complete, I discovered during
testing that the time required to parse a document grew exponentially as the
document grew longer. Performance was on par with CommonMark for shorter
documents, but fell increasingly behind in larger tests. Time profiling found
that the culprit was searching for link definitions when they didn&#8217;t exist.
My first approach was to keep a stack of used link definitions, and to iterate
through them when necessary. In long documents, this performs very poorly.
More research and I ended up using
<a href="http://troydhanson.github.io/uthash/">uthash</a>. This allows me to search for
a link (or footnote, etc.) by &#8220;name&#8221; rather than searching through an array.
This allowed me to get <abbr title="MultiMarkdown">MMD</abbr>&#8217;s performance back to O(n), taking roughly twice as
much time to process a document that is twice as long.</p>

<h4 id="efficientutilityfunctions">Efficient Utility Functions</h4>

<p>It is frequently necessary when parsing Markdown to check what sort of
character we are dealing with at a certain position &#8211; a letter, whitespace,
punctuation, etc. I created a lookup table for this via <code>char_lookup.c</code> and
hard-coded it in <code>char.c</code>. These routines allow me to quickly, and
consistently, classify any byte within a document. This saved a lot of
programming time, and saved time tracking down bugs from handling things
slightly differently under different circumstances. I also suspect it
improved performance, but don&#8217;t have the data to back it up.</p>

<h4 id="testingwhilewriting">Testing While Writing</h4>

<p>I developed several chunks of code in parallel while creating <abbr title="MultiMarkdown">MMD</abbr> 6. The vast
majority of it was developed largely in a <a href="https://en.wikipedia.org/wiki/Test-driven_development">test-driven development</a> approach.
The other code was largely created with extensive unit testing to accomplish
this.</p>

<p><abbr title="MultiMarkdown">MMD</abbr> isn&#8217;t particularly amenable to this approach at the small level, but
instead I relied more on integration testing with an ever-growing collection
of text files and the corresponding HTML files in the <abbr title="MultiMarkdown">MMD</abbr> 6 test suite. This
allowed me to ensure new features work properly and that old features aren&#8217;t
broken. At this time, there are 29 text files in the test suite, and many
more to come.</p>

<h4 id="otherlessons">Other Lessons</h4>

<p>Some things that didn&#8217;t do me any good&#8230;.</p>

<p>I considered differences between using <code>malloc</code> and <code>calloc</code> when initializing
tokens. The time saved by using <code>malloc</code> was basically exactly offset by the
initial time required to initialize the token to default null values as
compared to using <code>calloc</code>. When trying <code>calloc</code> failed to help me out
(thinking that clearing a single slab in the object pool would be faster), I
stuck with <code>malloc</code> as it makes more sense to me in my workflow.</p>

<p>I read a bit about <a href="http://www.catb.org/esr/structure-packing/">struct padding</a> and reordered some of my structs. It was
until later that I discovered the <code>-Wpadded</code> option, and it&#8217;s not clear
whether my changes modified anything. Since the structs were being padded
automatically, there was no noticeable performance change, and I didn&#8217;t have
the tools to measure whether I could have improved memory usage at all. Not
sure this would be worth the effort &#8211; much lower hanging fruit available.</p>

<h3 id="performance">Performance</h3>

<p>Basic tests show that currently <abbr title="MultiMarkdown">MMD</abbr> 6 takes about 20&#8211;25% longer the CommonMark
0.27.0 to process long files (e.g. 0.2 MB). However, it is around 5% <em>faster</em>
than CommonMark when parsing a shorter file (27 kB) (measured by parsing the
same file 200 times over). This test suite is performed by using the Markdown
[syntax page], modified to avoid the use of the Setext header at the top. The
longer files tested are created by copying the same syntax page onto itself,
thereby doubling the length of the file with each iteration.</p>

<p>The largest file I test is approximately 108 MB (4096 copies of the syntax
page). On my machine (2012 Mac mini with 2.3 GHz Intel Core i7, 16 GB RAM),
it takes approximately 4.4 seconds to parse with <abbr title="MultiMarkdown">MMD</abbr> 6 and 3.7 seconds with
CommonMark. <abbr title="MultiMarkdown">MMD</abbr> 6 processes approximately 25 MB/s on this test file.
CommonMark 0.27.0 gets about 29 MB/s on the same machine.</p>

<p>There are some slight variations with the smaller test files (8&#8211;32 copies),
but overall the performance of both programs (MMD 6 and CommonMark) are
roughly linear as the test file gets bigger (double the file size and it takes
twice as long to parse, aka O(n)).</p>

<p>Out of curiosity, I ran the same tests on the original Markdown.pl by Gruber
(v 1.0.2b8). It took approximately 178 seconds to parse 128 copies of the
file (3.4 MB) and was demonstrating quadratic performance characteristics
(double the file size and it takes 2<sup>2</sup> or 4 times longer to process, aka
O(n<sup>2</sup>)). I didn&#8217;t bother running it on larger versions of the test file. For
comparison, <abbr title="MultiMarkdown">MMD</abbr> 6 can process 128 copies in approximately 140 msec.</p>

<p>Of note, the throughput speed drops when testing more complicated files
containing more advanced MultiMarkdown features, though it still seems to
maintain linear performance characteristics. A second test file is created by
concatenating all of the test suite files (including the Markdown syntax
file). In this case, <abbr title="MultiMarkdown">MMD</abbr> gets about 13 MB/s. CommonMark doesn&#8217;t support
these additional features, so testing it with that file is not relevant. I
will work to see whether there are certain features in particular that are
more challenging and see whether they can be reworked to improve performance.</p>

<p>As above, I have done some high level optimization of the parse strategy, but
I&#8217;m sure there&#8217;s still a lot of room for further improvement to be made.
Suggestions welcome!</p>

<h3 id="testing">Testing</h3>

<h4 id="testsuite">Test Suite</h4>

<p>The development of <abbr title="MultiMarkdown">MMD</abbr> v6 was heavily, but not absolutely, influenced by the
philosophy of test-driven development. While coding, I made use of test
suites to verify successful implementation of new features, to avoid
regression problems when adding new features, and to identify known edge cases
in need of proper handling.</p>

<p>The test suite (located in <code>tests/MMD6Tests</code>) is a &#8220;living&#8221; collection of
documents that will continue to be updated as new bugs and edge cases are
identified. This helps make proper integration testing of the entire
application with every release.</p>

<h4 id="fuzztesting">Fuzz Testing</h4>

<p>I was not familiar with the concept of
<a href="https://en.wikipedia.org/wiki/Fuzzing">Fuzz Testing</a> until a user mentioned
something about it to me a year or two ago. I had never used it before, but
it seemed like a good idea. I implemented it in two ways.</p>

<p>The first is that I created a simplified version of the line parser that
simply accepts various combinations of line type identifiers to see if they
would successfully parse. The line parser is responsible for taking a series
of line types (e.g. plain text, indented line, etc.) and determining what sort
of block they should become. The file <code>test/parser_text.y</code> is run through the
<code>lemon</code> program, compiled (with or without the <code>-DNDEBUG</code> flag) and then run.
It sequentially throws every combination of line types at the simplified line
parser to make sure that it doesn&#8217;t choke. When I first did this, I found
several combinations of lines that did not pass.</p>

<p><strong>NOTE</strong>: This does not verify accurate parsing, simply that the parser does
not crash by an unacceptable combination of lines.</p>

<p>The second form of fuzz testing I started using later. This is using the
<a href="http://lcamtuf.coredump.cx/afl/">American fuzzy lop</a> program to try to find
text input that crashes <abbr title="MultiMarkdown">MMD</abbr>. This works by taking sample input (e.g. files
from the test suite), modifying them slightly, and trying the modified
versions. Do this over and over and over, and some interesting edge cases are
sometimes identified. I have found some interesting edge cases this way.
Definitely a useful tool!</p>

<h4 id="unittesting">Unit Testing</h4>

<p>Some of the original development was done with unit testing in some other
tools I developed. This code formed the basis of a few parts of <abbr title="MultiMarkdown">MMD</abbr>.
Otherwise, it was hard to see how to really create very good unit tests for
the development of <abbr title="MultiMarkdown">MMD</abbr>. So there is really not much unit testing built into
the code or used during the development.</p>

<h3 id="dependencieslibraries">Dependencies/Libraries</h3>

<p><abbr title="MultiMarkdown">MMD</abbr> v6 has no external dependencies when compiling, aside from the standard
libraries for C development (Except that it will use <code>libcurl</code> if available in
order to support downloading remote images/files for EPUB/FODT exporting.</p>

<p><abbr title="MultiMarkdown">MMD</abbr> can be compiled without any other tools beside the build system (cmake).</p>

<p>If you want to edit the block parser, you need to modify the <code>parser.y</code> file
and process that using <a href="http://www.hwaci.com/sw/lemon/">lemon</a> in order to update the <code>parser.c</code> file. The
lemon parser source is actually included in <abbr title="MultiMarkdown">MMD</abbr> and needs to be compiled to be
used.</p>

<p>If you want to update the lexer or scanner utility functions, then you can
modify <code>lexer.re</code> or <code>scanners.re</code>. These need to be processed using <a href="http://re2c.org/">re2c</a>,
which has to be installed separately.</p>

<p><abbr title="MultiMarkdown">MMD</abbr> v6 makes use of several other projects to improve performance and ease of
use:</p>

<ul>
<li><p><a href="https://troydhanson.github.io/uthash/">uthash</a> &#8211; provides support for hashes to quickly locate specific &#8220;objects&#8221;
based on text keys. These are used for matching footnotes, links, images and
the like when created with the reference syntax. Much faster than searching
through each one sequentially.</p></li>
<li><p><a href="https://github.com/richgel999/miniz">miniz</a> &#8211; provides zip archive support to enable creation of EPUB 3 files,
which are zip files with a specific file structure inside them.</p></li>
<li><p><a href="https://github.com/argtable/argtable3">argtable3</a> &#8211; provides more advanced command-line argument processing in a
more cross-platform approach than that used by <abbr title="MultiMarkdown">MMD</abbr> v5.</p></li>
<li><p><a href="https://curl.haxx.se/libcurl/">libCurl</a> &#8211; allows for easily downloading image assets from web servers in
order to embed them in packaged file formats, e.g. EPUB 3,
TextBundle/TextPack, OpenDocument, etc.</p></li>
</ul>

<h3 id="changelog">Changelog</h3>

<ul>
<li><p>2023&#8211;06&#8211;10 - v 6.7.0:</p>

<ul>
<li>ADDED: Add OBJECT_REPLACEMENT_CHARACTER token (fixes #216)</li>
<li>ADDED: Add compiler flag (DISABLE_OBJECT_POOL) to disable token pools</li>
<li>ADDED: Add more token types</li>
<li>Add Swift support</li>
<li>Avoid space to be eaten aways after a slash in latex export</li>
<li>CHANGED: Add additional TOC tests</li>
<li>CHANGED: Astyle</li>
<li>CHANGED: Reformat comment</li>
<li>FIXED: Centralize html fix</li>
<li>FIXED: Don&#8217;t output empty figure captions</li>
<li>FIXED: Fix Glossaries test</li>
<li>FIXED: Fix ambidextrous tokens inside of footnotes and other definitions</li>
<li>FIXED: Fix architecture issue when running multimarkdown from Xcode</li>
<li>FIXED: Fix edge case where table separator without leading pipe is treated as a list item</li>
<li>FIXED: Fix error detecting tables when indented in list items &#8211; Thanks, @wnm3!</li>
<li>FIXED: Fix flow control error</li>
<li>FIXED: Fix issue with certain nested lists</li>
<li>FIXED: Fix issue with escaping in URLs</li>
<li>FIXED: Fix issue with reference links with leading space instead of tab</li>
<li>FIXED: Fix regression from pull request that breaks build</li>
<li>FIXED: Fix style issue with ODT output format</li>
<li>FIXED: Fix trailing whitespace issues in headers/TOC</li>
<li>FIXED: Fix typo in xml.c</li>
<li>FIXED: Fix typos in error messages</li>
<li>FIXED: Improve README install path</li>
<li>FIXED: Improve edge cases around fenced code blocks and setext headers</li>
<li>FIXED: Improve markup handling around definition lists and colons</li>
<li>FIXED: Improve token mapping in header blocks</li>
<li>FIXED: Left out file</li>
<li>FIXED: Re-enable token object pools in default configuration</li>
<li>FIXED: Reset stack sizes before freeing temporary engine</li>
<li>FIXED: Restore prior label_counter after {{TOC}}</li>
<li>FIXED: Updated argtable3 now needs to link to math</li>
<li>FIXED: Use MultiMarkdown instead of libMultiMarkdown as title in version.h</li>
<li>FIXED: Use UTC for timestamp</li>
<li>FIXED: bibtex metadata should be raw</li>
<li>Merge branch &#8216;develop&#8217; of github.com:fletcher/MultiMarkdown-6 into develop</li>
<li>Merge branch &#8216;release/6.6.0&#8217; into develop</li>
<li>Merge pull request #210 from DivineDominion/swift-framework</li>
<li>Merge pull request #233 from DivineDominion/patch-4</li>
<li>Merge pull request #243 from alexban011/githubCi</li>
<li>Merge pull request #245 from hvellyr/develop</li>
<li>UPDATED: Apply astyle to all files</li>
<li>UPDATED: Include definition list colons as markup token</li>
<li>UPDATED: Project clean up</li>
<li>UPDATED: Update CMakeLists.txt for Universal Binary</li>
<li>UPDATED: Update astyle config</li>
<li>UPDATED: Update github CI for multiple platforms</li>
<li>UPDATED: Update lexers with newer version of re2c</li>
<li>UPDATED: Update to latest argtable3 code</li>
<li>UPDATED: standardize common source files</li>
<li>ci: added github CI</li>
<li>specify unsigned short for functions in token.h</li>
<li>use unsigned short in implementation, too</li>
</ul></li>
<li><p>2020&#8211;10&#8211;28 - v 6.6.0:</p>

<ul>
<li>UPDATED: Restructure source code organization; Restructure Cmake configuration file; restructure Makefile</li>
</ul></li>
<li><p>2020&#8211;10&#8211;28 - v 6.5.3:</p>

<ul>
<li>ADDED: Add additional blockquote tests</li>
<li>ADDED: Add format to create HTML with storing of assets</li>
<li>FIXED: Add latex footer to beamer output format (fixes #185)</li>
<li>FIXED: Allow hyphen in image/link unquoted attributes</li>
<li>FIXED: Don&#8217;t free NULL link</li>
<li>FIXED: Fix CMake issue</li>
<li>FIXED: Fix issue when parsing blockquote that contains raw HTML</li>
<li>FIXED: Fix issue with tight list where last item has multiple paragraphs not being recognized as a loose list</li>
<li>FIXED: Fix regression</li>
<li>FIXED: Fix test suite</li>
<li>FIXED: Improve blockquote parser</li>
<li>FIXED: Prevent iOS Safari from bastardizing left arrow unicode character with an ugly emoji</li>
<li>FIXED: tweak CriticMarkup highlight handling</li>
<li>Merge branch &#8216;develop&#8217; of github.com:fletcher/MultiMarkdown-6 into develop</li>
</ul></li>
<li><p>2020&#8211;04&#8211;10 - v 6.5.2:</p>

<ul>
<li>FIXED: Don&#8217;t use undefined version string</li>
<li>FIXED: Fix memory leak in ITMZ reader</li>
<li>FIXED: Update cpack generator for macOS</li>
<li>Fix fsf address in files licenses.</li>
<li>Merge pull request #184 from LyesSaadi/develop</li>
<li>UPDATED: Adjust cmake to only make library when included from a parent project</li>
</ul></li>
<li><p>2019&#8211;12&#8211;28 - v 6.5.1:</p>

<ul>
<li>FIXED: Ensure use of bash for creating AllTests.c</li>
<li>FIXED: Fix array overflow with wide tables</li>
<li>FIXED: Fix edge case error in definition lists</li>
<li>FIXED: Fix edge case in block parsing</li>
<li>FIXED: Fix edge case in fenced code blocks</li>
<li>FIXED: Fix error when pruning tokens</li>
<li>FIXED: Fix memory leak</li>
<li>FIXED: Fix metadata edge case</li>
<li>FIXED: Fix metadata parsing edge case</li>
<li>FIXED: Fix name mismatch of mmd6-default-metadata (Addresses #173)</li>
<li>FIXED: Fix null dereference</li>
<li>FIXED: Fix tests</li>
<li>FIXED: Fix typos</li>
<li>FIXED: Use more definitive edge case fix</li>
<li>UPDATED: Shorten hash function for compiling speed since we are hashing shorter strings</li>
<li>UPDATED: Update notes source text</li>
</ul></li>
<li><p>2019&#8211;12&#8211;11 - v 6.5.0:</p>

<ul>
<li>ADDED: Add ASCII case detection</li>
<li>ADDED: Add conversion from ITMZ routines</li>
<li>ADDED: Add support for random header labels when not manually specified (Addresses #157)</li>
<li>ADDED: Add title as short caption for figures and tables to be used in list of figures and list of tables. Addresses #177 &#8211; thanks, 	MArpogaus</li>
<li>ADDED: Add {{TOC:1}} and {{TOC:1-2}} options</li>
<li>FIXED: Add byte for null terminator when extracting from zip archive</li>
<li>FIXED: Allow building lib<abbr title="MultiMarkdown">MMD</abbr> has a child project for testing</li>
<li>FIXED: Clean up Quick Start guide</li>
<li>FIXED: Ensure newline at end of header contents when importing from OPML/ITMZ</li>
<li>FIXED: Fix CMake config for MacPorts (fixes #146)</li>
<li>FIXED: Fix PATH in convenience scripts</li>
<li>FIXED: Fix bugs in new zip extraction code</li>
<li>FIXED: Fix edge case with single item loose lists (fixes #174)</li>
<li>FIXED: Fix filename</li>
<li>FIXED: Fix handling of hebrew language option</li>
<li>FIXED: Fix length of metadata if no trailing line ending</li>
<li>FIXED: Fix letterhead reference to memoir-footer. (Fixes #143)</li>
<li>FIXED: Fix memory leak (#172) &#8211; thanks Alfons</li>
<li>FIXED: Fix pointer dereference (fixes #152)</li>
<li>FIXED: Fix potential bug when reading OPML/ITMZ</li>
<li>FIXED: Fix potential errors related to checking for metadata</li>
<li>FIXED: Fix potential issue in d_string</li>
<li>FIXED: Fix potential memory address error</li>
<li>FIXED: Fix prior bad edits to quick start guide</li>
<li>FIXED: Fix regression</li>
<li>FIXED: Fix test suite for new captions</li>
<li>FIXED: Fix trim trailing whitespace</li>
<li>FIXED: Fix two small potential errors</li>
<li>FIXED: Fix warning</li>
<li>FIXED: Fix whitespace issues with headers with manual labels</li>
<li>FIXED: Improve BOM stripping</li>
<li>FIXED: Improve efficiency when checking for existence of metadata</li>
<li>FIXED: Include .html for EPUB and .fodt for ODT when transcluding with wildcard extension</li>
<li>FIXED: Prevent line breaks in HTML/ODF attributes</li>
<li>FIXED: Update Quick Start PDF</li>
<li>FIXED: Update README template</li>
<li>FIXED: Update re2c scanners and prevent crash on certain documents with unexpected encoding</li>
<li>FIXED: Use C11 (had old C99 as well, but I suspect that wasn&#8217;t actually used</li>
<li>Fixes to README</li>
<li>Merge branch &#8216;develop&#8217; of github.com:fletcher/MultiMarkdown-6 into develop</li>
<li>Merge branch &#8216;release/6.4.0&#8217; into develop</li>
<li>Merge pull request #144 from cdhutch/patch-3</li>
<li>Merge pull request #162 from DivineDominion/patch-1</li>
<li>Merge pull request #167 from nickasd/develop</li>
<li>Revert &#8220;remove build folder&#8221;</li>
<li>UPDATED: Add MARKUP token type</li>
<li>UPDATED: Add OPML routines to libMultiMarkdown.h</li>
<li>UPDATED: Add UTF-8 validity check function</li>
<li>UPDATED: Additional README comments about Xcode</li>
<li>UPDATED: Apply astyle</li>
<li>UPDATED: Automatically disable libCurl on iOS</li>
<li>UPDATED: Change convenience scripts for better POSIX compliance (implements #150) (Thanks, Ryan)</li>
<li>UPDATED: Don&#8217;t require opening &lt;?xml&gt; in OPML</li>
<li>UPDATED: Fix doxygen template</li>
<li>UPDATED: Fix main() when token pools disabled</li>
<li>UPDATED: Make astyle</li>
<li>UPDATED: Refactor XML parsing; improve OPML reading; add ITMZ (iThoughts) reading/writing (experimental feature); a few other small tweaks</li>
<li>UPDATED: Refactor header file inclusion</li>
<li>UPDATED: Remove debug statement</li>
<li>UPDATED: Remove i386 build architecture from default configuration</li>
<li>UPDATED: Remove some old debugging statements that aren&#8217;t necessary anymore</li>
<li>UPDATED: Silence some Xcode warnings</li>
<li>UPDATED: Silence warnings</li>
<li>UPDATED: Tidy code</li>
<li>UPDATED: Tweak smart quote rules to avoid false positive matches when using double quote as inches mark</li>
<li>UPDATED: Update advanced headers test suite</li>
<li>UPDATED: Update astyle</li>
<li>UPDATED: Update astyle settings</li>
<li>UPDATED: Update char.c</li>
<li>UPDATED: Update cmake for xcode 11</li>
<li>UPDATED: Update d_string</li>
<li>UPDATED: Update macOS deployment version to 10.6 for Mojave</li>
<li>UPDATED: reduce false-positive rate of metadata where first line contains colon but metadata is not intended</li>
<li>UPDATED: remove reliance on version.h when testing</li>
<li>UPDATED: table id attribute should be on table not caption</li>
<li>Update mmd6-letterhead-leader.tex</li>
<li>add how to build Xcode framework to README</li>
<li>remove build folder</li>
<li>update README with instructions for Xcode</li>
</ul></li>
<li><p>2018&#8211;09&#8211;01 - v 6.4.0:</p>

<ul>
<li>ADDED: Add ODF Header metadata and fix issue with LaTeX Header metadata</li>
<li>ADDED: Add additional tests for special characters</li>
<li>ADDED: Add initial OPML export support (address #9)</li>
<li>ADDED: Add opml option to read for MultiMarkdown OPML files</li>
<li>Add missing Latex support files</li>
<li>Avoid potential error with stack_free</li>
<li>CHANGED: Remove unnecessary code</li>
<li>FIXED: Allow caption without trailing newline at end of document</li>
<li>FIXED: Escape square brackets, e.g. &#8216;{[foo]}&#8217; (addresses #128 and #129)</li>
<li>FIXED: Fix escpaing of % character in LaTeX code spans and blocks</li>
<li>FIXED: Fix html comments inside code blocks (fixes #118)</li>
<li>FIXED: Fix issue where <code>~</code> is mistakenly interpreted as fence delimiter</li>
<li>FIXED: Fix issue with BOM and files &gt; 4k</li>
<li>FIXED: Fix issue with dollar math delimiters inside code (fixes #134)</li>
<li>FIXED: Fix token length in OPML</li>
<li>FIXED: Improve OPML export; add OPML tests</li>
<li>FIXED: Normalize line spacing in CriticMarkup notes in LaTeX (fixes #120)</li>
<li>FIXED: Preserve tabs following leading hashes in code blocks</li>
<li>FIXED: Prevent potential null dereference</li>
<li>FIXED: Remove lock file</li>
<li>FIXED: Trim single remaining whitespace when exporting headers</li>
<li>FIXED: Trim trailing newlines in definition blocks</li>
<li>FIXED: Use Setext headers when necessary to convert from OPML to text (fixes #138)</li>
<li>FIXED: Use \ul instead of \underline when soul package is in use (fixes #121)</li>
<li>Merge pull request #132 from jlargentaye/develop</li>
<li>UPDATE: Clarify DevelopmentNotes re: libcurl</li>
<li>UPDATE: Clarify README re: libcurl</li>
<li>UPDATED: &#8216;\item{}&#8217; no longer needed since square brackets escaped on their own</li>
<li>UPDATED: Add 6.3.1 release notes</li>
<li>UPDATED: Add allowfullscreen to list of boolean HTML attributes</li>
<li>UPDATED: Add more BibTeX test cases</li>
<li>UPDATED: Adjust metadata for test files</li>
<li>UPDATED: Allow '' to preserve line break in metadata. (Addresses #86)</li>
<li>UPDATED: Apply astyle</li>
<li>UPDATED: Fix whitespace with boolean HTML attributes</li>
<li>UPDATED: Ignore escaped space at end of code span</li>
<li>UPDATED: Test % escaping in URLs</li>
</ul></li>
<li><p>2018&#8211;03&#8211;28 - v 6.3.2:</p>

<ul>
<li>UPDATED: Update documentation</li>
</ul></li>
<li><p>2018&#8211;03&#8211;27 - v 6.3.1:</p>

<ul>
<li>ADDED: Add beamer support for code highlighting</li>
<li>ADDED: Add extra tests for variations on link types</li>
<li>ADDED: Add integrated memoir test</li>
<li>ADDED: Migrate manuscript and memoir(book) LaTeX formats to <abbr title="MultiMarkdown">MMD</abbr>-6</li>
<li>FIXED: Checking for metadata was partially erasing token tree and leaving engine in invalid state</li>
<li>FIXED: Explicitly disable metadata in compatibility mode</li>
<li>FIXED: Fix Makefile for Windows 32-bit zip</li>
<li>FIXED: Fix detection of invalid request to copy substring of DString</li>
<li>FIXED: Fix issue with empty metadata lines</li>
<li>FIXED: Fix issue with raw source markers(fixes #115)</li>
<li>FIXED: Fix issue with trailing ATX hash without final newline</li>
<li>FIXED: Fix potential pointer overflow if line starts with &#8216;:::&#8217;</li>
<li>FIXED: Improve internal link creation in LaTeX</li>
<li>FIXED: Improve logic for disabling metadata</li>
<li>FIXED: Improve parsing of HTML 5 <video> tag</li>
<li>UPDATED: Add beginnings of Beamer test suite; add support for beamer/memoir and raw text blocks</li>
<li>UPDATED: Update quick start guide</li>
<li>UPDATED: Update remaining tests for LaTeX change</li>
</ul></li>
<li><p>2018&#8211;02&#8211;05 - v 6.3.0:</p>

<ul>
<li>ADDED: Add additional CM tests</li>
<li>ADDED: Add beamer LaTeX support files to installer</li>
<li>ADDED: Update beamer latex support files for <abbr title="MultiMarkdown">MMD</abbr> 6 latex config metadata support</li>
<li>FIXED: All test build on path with spaces</li>
<li>FIXED: Don&#8217;t use libcurl on test build</li>
<li>FIXED: Fix HTML 5 compliance with image dimensions; Fix CriticMarkup inside code spans/blocks</li>
<li>FIXED: Fix bug in token pruning</li>
<li>FIXED: Fix bug with setting tail in token prune/graft</li>
<li>FIXED: Fix edge case with superscripts and punctuation</li>
<li>FIXED: Fix issue in Windows code</li>
<li>FIXED: Fix issue with list bullets in fenced code blocks</li>
<li>FIXED: Fix reject/accept with highlighting</li>
<li>FIXED: Fix typo in QuickStart.txt (fixes #111)</li>
<li>FIXED: Properly assign ambidextrous tokens in tables</li>
<li>Fix encoding of some markup inside LaTeX texttt environment (fixes #110 and #108)</li>
<li>UPDATED: Add Spanish style quotes support</li>
<li>UPDATED: Add test suite to d_string</li>
<li>UPDATED: Apply astyle to source</li>
<li>UPDATED: Improve commands for accepting/rejecting CriticMarkup</li>
<li>UPDATED: Remove deprecated fodt.c and fodt.h</li>
<li>UPDATED: Update dates</li>
<li>UPDATED: specify types to silence warnings and prevent theoretical errors</li>
<li>add cocoaconv.rb enum conversion script</li>
<li>change d_string_erase argument docstring</li>
<li>drop redundant enum case prefixes in Swift</li>
<li>drop redundant enum name prefixes from enum cases</li>
<li>expose singular-S type to Swift code generator</li>
<li>fix target platform spelling (macosx, not macos)</li>
<li>remove plural S from enum type names</li>
</ul></li>
<li><p>2017&#8211;11&#8211;20 - v 6.2.3:</p>

<ul>
<li>CHANGED: Fix typos</li>
<li>CHANGED: Update superscript/subscript algorithm to allow leading instances</li>
<li>FIXED: Fix bug with multiple footnotes in single paragraph when exporting to LaTeX</li>
<li>FIXED: Fix potential NULL pointer dereference</li>
<li>FIXED: Fix potential bug</li>
<li>FIXED: Prevent pointer overflow</li>
<li>FIXED: Strip UTF-8 BOM from main files, not just transcluded files</li>
<li>UPDATED: Add HTML comment test cases to further demonstrate</li>
<li>UPDATED: Adjust libMultiMarkdown.h so it does not recursively include other files</li>
<li>UPDATED: Fix issue with AStyle indent settings</li>
<li>UPDATED: Refactor file utilities into file.c/h</li>
<li>UPDATED: Silence Xcode static analyzer false positives</li>
<li>UPDATED: Silence analyzer warnings</li>
<li>UPDATED: Update function name in swift file</li>
</ul></li>
<li><p>2017&#8211;10&#8211;13 - v 6.2.2.:</p>

<ul>
<li>ADDED: Add support for tables without header; test for table with multiple header rows</li>
<li>CHANGED: Remove dead line of code</li>
<li>FIXED: Add NULL check on my strdup functions</li>
<li>FIXED: Fix NULL dereference in abbreviation search</li>
<li>FIXED: Fix issue with libCurl on some systems (Thanks, Brad!)</li>
<li>FIXED: Fix math markers in code spans</li>
<li>FIXED: Fix potential dereference in table handling</li>
<li>FIXED: Fix use of uninitialized variable</li>
<li>FIXED: Improve consistency of math token handling</li>
<li>FIXED: Relax table separator line rules to allow missing final pipe</li>
<li>UPDATED: Add additional asset storage option</li>
<li>UPDATED: Add note about tables in <abbr title="MultiMarkdown">MMD</abbr>-6 to Quick Start Guide</li>
<li>UPDATED: Fix readme</li>
<li>UPDATED: Update QuickStart Guide</li>
<li>UPDATED: Update readme</li>
</ul></li>
<li><p>2017&#8211;09&#8211;04 - v 6.2.1:</p>

<ul>
<li>ADDED: Add Hebrew to command line help</li>
<li>ADDED: Add function to extract transclusion manifest</li>
<li>FIXED: Fix Windows issue (#80) - Thanks @f8ttyc8t</li>
<li>FIXED: Fix error in CriticMarkup highlights when accepting/rejecting (Thanks, Shahaf!)</li>
<li>FIXED: Fix issue with metadata extraction</li>
<li>FIXED: Fix issues with Windows compiling</li>
<li>FIXED: Fix potential bug</li>
<li>FIXED: Remove non-existent mmd2all.bat</li>
<li>FIXED: Store directories in zip file without compression to avoid error</li>
<li>UPDATED: Fix bug (I think) in Tufte LaTeX files</li>
<li>UPDATED: Tidy up BibTeX example</li>
<li>UPDATED: Update DevelopmentNotes</li>
<li>UPDATED: Update Swedish/Dutch handling</li>
<li>UPDATED: Update astyle</li>
<li>UPDATED: update miniz to 2.0.6 beta</li>
</ul></li>
<li><p>2017&#8211;08&#8211;15 - v 6.2.0:</p>

<ul>
<li>ADDED: Add Dutch and Swedish translations &#8211; thanks Sl!</li>
<li>ADDED: Add Hebrew translation &#8211; thanks Sl!</li>
<li>ADDED: Add functions to insert/replace metadata</li>
<li>ADDED: Add stack_sort header</li>
<li>ADDED: Add support for <abbr title="MultiMarkdown">MMD</abbr> Header and <abbr title="MultiMarkdown">MMD</abbr> Footer metadata; FIXED: Fix transclusion to skip over metadata in main document; FIXED: Fix metavalue_for_key with NULL result</li>
<li>ADDED: Add support for YAML metadata markers (&#8212;)</li>
<li>CHANGED: Find single non-indenting space at beginning of lines</li>
<li>CHANGED: Migrate to Travis containers</li>
<li>CHANGED: Preserve leading non-indent space in fenced code blocks</li>
<li>CHANGED: Reorder export format definitions</li>
<li>CHANGED: Safety check to avoid potential crash</li>
<li>CHANGED: Standardize process for FORMAT_<abbr title="MultiMarkdown">MMD</abbr></li>
<li>CHANGED: Verbose testing in Travis</li>
<li>FIXED: Don&#8217;t strip leading indent in fenced code blocks</li>
<li>FIXED: Fix CTest for spaces in directory path</li>
<li>FIXED: Fix YAML metadata in transcluded files</li>
<li>FIXED: Fix bug preventing matching of abbreviations and glossary items inside tight list items</li>
<li>FIXED: Fix bugs in d_string_replace_text_in_range()</li>
<li>FIXED: Fix issue on Travis-CI Linux and file paths</li>
<li>FIXED: Fix memory bug and silence warnings</li>
<li>FIXED: Fix memory leak</li>
<li>FIXED: Fix potential crash</li>
<li>FIXED: Fix table wrapping with default alignment</li>
<li>FIXED: Improve abbreviation support</li>
<li>FIXED: Improve file path resolution with transclude base &#8216;.&#8217;</li>
<li>FIXED: Improve safety of realpath</li>
<li>FIXED: Include version.h in public headers</li>
<li>FIXED: Remove useless RTF scripts</li>
<li>FIXED: Tweak makefile</li>
<li>Merge branch &#8216;release/6.1.0&#8217; into develop</li>
<li>TESTING: Figure out why Travis linux fails</li>
<li>TESTING: Working on Travis</li>
<li>UPDATED: Add astyle configuration to tidy c source files</li>
<li>UPDATED: Remove obsolete test</li>
<li>UPDATED: Replace vasprintf for all build environments to simplify things</li>
<li>UPDATED: Test on linux and osx with travis</li>
<li>UPDATED: Tidy up code</li>
<li>UPDATED: Tweak astyle settings</li>
<li>UPDATED: Tweaked astyle settings</li>
<li>UPDATED: Update quick start guide</li>
<li>UPDATED: Use astyle with header files as well</li>
</ul></li>
<li><p>2017&#8211;07&#8211;06 - v 6.1.0:</p>

<ul>
<li>ADDED: Add &#8216;&#8211;nosmart&#8217; option to disable smart typography</li>
<li>ADDED: Add &#8216;notransclude&#8217; option</li>
<li>ADDED: Add Travis CI configuration</li>
<li>ADDED: Add odt and fodt formats; disable odf format for consistency</li>
<li>ADDED: Add regular TextBundle format support</li>
<li>ADDED: Add support for &#8216;latexauthor&#8217; and &#8216;latextitle&#8217; metadata (Addresses #58)</li>
<li>ADDED: Add syntax for raw source (Addresses #38)</li>
<li>ADDED: Start working on textbundle output format</li>
<li>ADDED: Store image assets in OpenDocument files</li>
<li>ADDED: Use assets for reference image definitions in TextBundle format</li>
<li>CHANGED: Disable &#8216;bundle&#8217; format until it&#8217;s finished</li>
<li>CHANGED: Make epub utility functions static</li>
<li>CHANGED: Remove odf files; replace convenience scripts</li>
<li>CHANGED: Use &#8216;markdown&#8217; file extension</li>
<li>FIXED: Add ODF to wilcard transcluding; Fix tufte to support latex title</li>
<li>FIXED: Avoid a few potential crashes</li>
<li>FIXED: Don&#8217;t parse <abbr title="MultiMarkdown">MMD</abbr> inside math (fixes #69)</li>
<li>FIXED: Fix asset path for CSS metadata</li>
<li>FIXED: Fix issue where tight list items not properly processed for smart typography</li>
<li>FIXED: Fix issue with transclusion and relative paths</li>
<li>FIXED: Fix regression and add newline at end of converted strings</li>
<li>FIXED: Fix two potential crashes</li>
<li>FIXED: Improve apostrophe detection after punctuation mark</li>
<li>FIXED: Improve handling of HTML entities (fixed #71)</li>
<li>FIXED: Improve transclusion search folder resolution</li>
<li>FIXED: PATH_MAX isn&#8217;t reliable</li>
<li>FIXED: Refactor super/subscript parsing (fixes #70)</li>
<li>FIXED: Silence a few warnings</li>
<li>FIXED: Use .bat files for Windows installer (fixes #74)</li>
<li>UPDATE: Use custom strdup() replacement</li>
<li>UPDATED: Fix whitespace</li>
<li>UPDATED: Include build status in README</li>
<li>UPDATED: Include html version in Textbundle</li>
<li>UPDATED: Update parser to track headers, even in compatibility mode</li>
</ul></li>
<li><p>2017&#8211;05&#8211;24 - v 6.0.7:</p>

<ul>
<li>CHANGED: Add mmd_convert_to_data functions; Refactor main.c so that EPUB and other formats use same workflow &#8211; batch mode no longer required for EPUB format</li>
</ul></li>
<li><p>2017&#8211;05&#8211;24 - v 6.0.6:</p>

<ul>
<li>ADDED: Add function for accessing library version</li>
<li>ADDED: Restructure superscript</li>
<li>CHANGED: Continue to refactor core API routines for clarity and flexibility</li>
<li>CHANGED: Don&#8217;t strip list markers from nested list items</li>
<li>CHANGED: Extended ASCII support interferes with UTF-8 support &#8211; disable it</li>
<li>CHANGED: Fix style</li>
<li>CHANGED: Preserve closing Heading markers</li>
<li>CHANGED: Refactor CriticMarkup basic commands to be part of libMultiMarkdown.h</li>
<li>CHANGED: Refactor code for more consistent API naming in libMultiMarkdown.h; Add functionality to list metadata keys and extract specific metadata values</li>
<li>CHANGED: Refactor transclude_source to be part of main libMultiMarkdown.h</li>
<li>CHANGED: Restructure strong/emph to a nested structure</li>
<li>FIXED: Adjust CMake configuration for Linux to allow building with libcurl</li>
<li>FIXED: Fix regression in EPUB code refactoring</li>
<li>FIXED: Need separate check for escaped characters in CriticMarkup parsing</li>
<li>FIXED: compiling with older gcc and used c standard</li>
<li>Merge pull request #61 from silvio/gcc-build-fix</li>
<li>Merge pull request #64 from jasedit/feat/add_version_function</li>
<li>NOTE: Remove unnecessary includes</li>
<li>UPDATED: Update libMultiMarkdown.h</li>
<li>UPDATED: Update mmd.c</li>
</ul></li>
<li><p>2017&#8211;05&#8211;02 - v 6.0.5:</p>

<ul>
<li>ADDED: Add back support for BibTeX bibliography entries (address #56)</li>
<li>CHANGED: Adjust &gt; and &lt; in LaTeX output &#8211; don&#8217;t wrap in math</li>
<li>CHANGED: Change HTML output for footnotes and citations</li>
<li>CHANGED: Improve flexibility of HTML Comment parsing (Addresses #25)</li>
<li>CHANGED: Refactor mmd_engine cleanup</li>
<li>CHANGED: Remove unnecessary variable</li>
<li>CHANGED: Rename criticmarkup functions</li>
<li>CHANGED: Tweak Xcode configuration</li>
<li>FIXED: Fix bug in mmd_tokenize_string()</li>
<li>FIXED: Fix memory leak</li>
<li>FIXED: Fix pointer bug</li>
<li>FIXED: Fix underscore strong/emph around punctuation</li>
<li>FIXED: Improve memory management</li>
<li>FIXED: Reset stacks when parsing</li>
</ul></li>
<li><p>2017&#8211;04&#8211;09 - v 6.0.4:</p>

<ul>
<li>ADDED: The &#8216;-l&#8217; command line argument also sets language, if not overridden by metadata</li>
<li>FIXED: Fix regular expression to match table separator lines. (Fixes #50)</li>
<li>FIXED: Improve organization of fallback lines for fenced code blocks and HTML blocks</li>
</ul></li>
<li><p>2017&#8211;03&#8211;29 - v 6.0.3:</p>

<ul>
<li>ADDED: Script for updating re2c and lemon files</li>
<li>CHANGED: Recompile lexer using -8 flag</li>
<li>CHANGED: Recompile scanners using -8 flag</li>
<li>FIXED: Don&#8217;t separate out &#8216;à&#8217;</li>
</ul></li>
<li><p>2017&#8211;03&#8211;29 - v 6.0.2:</p>

<ul>
<li>CHANGED: Refactor code slightly</li>
<li>CHANGED: Remove ASCII non-breaking space support from lexer</li>
<li>FIXED: Fix quote pairing in compatibility mode</li>
</ul></li>
<li><p>2017&#8211;03&#8211;28 &#8211; v 6.0.1:</p></li>
<li><p>CHANGED: Adjust LaTeX support files</p></li>
<li><p>CHANGED: Fix potential bug in tokenize function</p></li>
<li><p>FIXED: Fix bug between ASCII 160 (non-breaking space) and &#8216;à&#8217; character</p></li>
<li><p>FIXED: Improve transclude base overriding of search paths, and explain change in QuickStart guide</p></li>
<li><p>UPDATED: Update QuickStart to include more info about LaTeX</p></li>
<li><p>2017&#8211;03&#8211;22 &#8211; v 6.0.0:</p>

<ul>
<li>Version bump</li>
</ul></li>
<li><p>2017&#8211;03&#8211;21 &#8211; v 6.0.0-rc3:</p>

<ul>
<li>ADDED: Add command line support for nl/sv quotes; Improve help screen organization</li>
<li>CHANGED: Refactor enumerations</li>
<li>FIXED: Fix potential bug in CriticMarkup handling</li>
</ul></li>
<li><p>2017&#8211;03&#8211;19 &#8211; v 6.0.0-rc2:</p>

<ul>
<li>ADDED: Add debugging info</li>
<li>ADDED: Add image assets when creating EPUB</li>
<li>ADDED: Add mmd2epub convenience script</li>
<li>ADDED: Add support for random footnote numbers</li>
<li>ADDED: Include tables as targets for cross-reference links</li>
<li>ADDED: Store css metadata as asset</li>
<li>CHANGED: Table captions now bottom aligned in HTML</li>
<li>CHANGED: Update license and development notes</li>
<li>FIXED: Fix Fuzz LaTeX test</li>
<li>FIXED: Fix bug in HR parsing</li>
<li>FIXED: Fix bug in determining label for headers</li>
<li>FIXED: Fix bug in printing NULL strings</li>
<li>FIXED: Fix bug in transclusion code</li>
<li>FIXED: Fix cmake to find on *nix systems libcurl</li>
<li>FIXED: Fix crash in parsing URL destinations</li>
<li>FIXED: Fix crash in reference definitions</li>
<li>FIXED: Fix potential crash</li>
<li>FIXED: Fix potential crash in definitions</li>
<li>FIXED: Fix regression in transclusion</li>
<li>FIXED: Free memory from asset hash</li>
<li>FIXED: Improve Spanish translations</li>
<li>FIXED: Improve token_split() algorithm and searching for abbreviations and glossary terms in text</li>
<li>FIXED: Improve width/height attributes for HTML images</li>
<li>FIXED: Update Spanish, update Spanish test suite, add languages to help screen</li>
<li>FIXED: Update table caption alignment for CSS instead of deprecated alignment</li>
<li>UPDATE: Update documentation</li>
<li>UPDATED: Add notes to main.swift</li>
</ul></li>
<li><p>2017&#8211;03&#8211;15 &#8211; v 6.0.0-rc1:</p>

<ul>
<li>FIXED: Add missing CriticMarkup tokens to LaTeX</li>
<li>FIXED: Don&#8217;t let labels end on '' that is escaping the closing &#8216;]&#8217;</li>
<li>FIXED: Fix NULL pointer dereference</li>
<li>FIXED: Fix bug in Aho-Corasick implementation</li>
<li>FIXED: Fix bug with ATX Headers without newline</li>
<li>FIXED: Fix bug with Setext header starting with &#8216;:&#8217;</li>
<li>FIXED: Fix bug with leading spaces in abbreviation references</li>
<li>FIXED: Fix crash with empty definition</li>
<li>FIXED: Fix edge case with URL definitions</li>
<li>FIXED: Fix edge case with superscripts</li>
<li>FIXED: Fix null dereference error in CriticMarkup substitution</li>
<li>FIXED: Fix potential bug in Aho-Corasick search:</li>
<li>FIXED: Fix potential bug in storing items to hash</li>
<li>FIXED: Fix potential bug with line-&gt;block parser</li>
<li>FIXED: Fix potential crash in attribute parsing</li>
<li>FIXED: Fix printing raw CriticMarkup tokens in LaTeX</li>
<li>FIXED: Fix signedness bug in Aho-Corasick</li>
<li>FIXED: Improve metadata edge cases; Fix NULL pointer dereference</li>
<li>FIXED: Include non-breaking space (ASCII 160) in re2c patterns</li>
<li>FIXED: Keep &#8216;:&#8217; in false positive definitions</li>
<li>FIXED: Lex space followed by tab as space, not text</li>
<li>FIXED: Limit lines treated as ATX headers</li>
<li>FIXED: Update test code</li>
</ul></li>
<li><p>2017&#8211;03&#8211;13 &#8211; v 6.0.0-b2:</p>

<ul>
<li>ADDED: Add CriticMarkup preprocessor that works across empty lines when accepting/rejecting markup</li>
<li>ADDED: Add back the mmd6 latex title file</li>
<li>ADDED: Basic EPUB 3 support &#8211; uses &#8216;miniz&#8217; library to zip creation</li>
<li>ADDED: Update QuickStart and EPUB code</li>
<li>CHANGED: Update QuickStart guide</li>
<li>CHANGED: Update test suite</li>
<li>FIXED: Don&#8217;t duplicate LaTeX glossary definitions</li>
<li>FIXED: Fix abbreviations in ODF; Improve test suite</li>
<li>FIXED: Improve glossaries and abbreviations; Update QuickStart</li>
<li>FIXED: Tidy up some compiler warnings in code</li>
<li>FIXED: Use custom UUID code to minimize external dependencies</li>
</ul></li>
<li><p>2017&#8211;03&#8211;09 &#8211; v 6.0.0-b1:</p>

<ul>
<li>ADDED: Add French translations; fix typo in German</li>
<li>ADDED: Add Quick Start guide</li>
<li>ADDED: Add functionality to automatically identify abbreviations and glossary terms in source</li>
<li>ADDED: Improve LaTeX configuration files</li>
<li>ADDED: Update German translations</li>
<li>ADDED: Use native ODF table of contents instead of a manual list</li>
<li>ADDED: Use native command for table of contents in LaTeX</li>
<li>CHANGED: Bring HTML and ODF into line with LaTeX as to output of abbreviatinos on first and subsequent uses</li>
<li>CHANGED: Slight performance tweak</li>
<li>CHANGED: Update German test suite</li>
<li>FIXED: Allow <code>{{TOC}}</code> in latex verbatim</li>
<li>FIXED: Don&#8217;t free token_pool if never initialized</li>
<li>FIXED: Fix German typo</li>
<li>FIXED: Fix missing token type</li>
<li>FIXED: Improve performance of checking document for metadata, which improves performance when checking for possible transclusion</li>
<li>FIXED: Update test suite for abbreviation changes</li>
</ul></li>
<li><p>2017&#8211;03&#8211;05 &#8211; v 0.4.2-b:</p>

<ul>
<li>ADDED: Add and utility functions; fix memory leak</li>
<li>ADDED: Initial abbreviation support</li>
<li>ADDED: Keep working on Abbreviations/Glossaries</li>
<li>ADDED: Refactor abbreviation code; Add inline abbreviations; Fix abbreviations in ODF</li>
<li>ADDED: Update Inline Footnote test</li>
<li>CHANGED: Add comments to i18n.h</li>
<li>CHANGED: Finish refactoring note-related code</li>
<li>CHANGED: Refactor footnotes</li>
<li>CHANGED: Refactor glossary code</li>
<li>CHANGED: Remove offset from html export functions</li>
<li>FIXED: latex list items need to block optional argument to allow &#8216;[&#8217; as first character</li>
<li>Merge branch &#8216;release/0.4.1-b&#8217; into develop</li>
</ul></li>
<li><p>2017&#8211;03&#8211;04 &#8211; v 0.4.1-b:</p>

<ul>
<li>FIXED: Add glossary localization</li>
</ul></li>
<li><p>2017&#8211;03&#8211;04 &#8211; v 0.4.0-b:</p>

<ul>
<li>ADDED: Add TOC support to ODF</li>
<li>ADDED: Add glossary support to ODF</li>
<li>ADDED: Add prelim code for handling abbreviations</li>
<li>ADDED: Add support for Swift Package Maker; CHANGED: Restructure source directory</li>
<li>ADDED: Added LaTeX support for escaped characters, fenced code blocks, images, links</li>
<li>ADDED: Basic ODF Support</li>
<li>ADDED: Better document strong/emph algorithm</li>
<li>ADDED: Continue ODF progress</li>
<li>ADDED: Continue to work on ODF export</li>
<li>ADDED: Continue work on ODF</li>
<li>ADDED: Finish ODF support for lists</li>
<li>ADDED: Improve performance when exporting</li>
<li>ADDED: Improve token_pool memory handling</li>
<li>ADDED: Prototype support for Glossaries</li>
<li>ADDED: Support &#8216;latexconfig&#8217; metadata</li>
<li>CHANGED: Use multiple cases in glossary tests</li>
<li>FIXED: Don&#8217;t force glossary terms into lowercase</li>
<li>FIXED: Fix Makefile for new source file location</li>
<li>FIXED: Fix algorithm for creating TOC to properly handle &#8216;incorrect&#8217; levels</li>
<li>FIXED: Fix linebreaks in LaTeX; ADDED: Add Linebreaks test file</li>
<li>FIXED: Fix new_source script for new directory structure</li>
<li>FIXED: Fix non-breaking space in ODF</li>
<li>FIXED: Fix padding at end of document body in ODF</li>
<li>FIXED: Fix underscores in raw latex</li>
<li>FIXED: Potential bug</li>
<li>NOTE: Add shared library build option</li>
</ul></li>
<li><p>2017&#8211;02&#8211;17 &#8211; v 0.3.1.a:</p>

<ul>
<li>ADDED: &#8216;finalize&#8217; beamer support</li>
<li>ADDED: Add escaped newline as linebreak; start on beamer/memoir support</li>
<li>ADDED: CriticMarkup test for LaTeX</li>
<li>ADDED: Custom LaTeX output for CriticMarkup comments</li>
<li>ADDED: Support mmd export format</li>
<li>ADDED: Work on cpack installer &#8211; change project name for compatibility</li>
<li>CHANGED: Adjust latex metadata configuration for consistency</li>
<li>CHANGED: Configure cmake to use C99</li>
<li>FIXED: Add custom implementation for cross-platform support</li>
<li>FIXED: Fix German HTML tests</li>
<li>FIXED: Fix cpack destination directory issue</li>
<li>FIXED: Fix memory leaks etc</li>
<li>FIXED: Fix warning in custom vasprintf</li>
<li>FIXED: Modify CMakeLists.txt to test for use of clang compiler</li>
<li>FIXED: Work on memory leaks</li>
<li>NOTE: Adjust license width to improve display on smaller terminal windows</li>
</ul></li>
<li><p>2017&#8211;02&#8211;14 &#8211; v 0.3.0a:</p>

<ul>
<li>ADDED: Add basic image support to LaTeX</li>
<li>ADDED: Add file transclusion</li>
<li>ADDED: Add support for citation &#8216;locators&#8217;</li>
<li>ADDED: Add support for manual labels on ATX Headers</li>
<li>ADDED: Add support for manual labels on Setext Headers</li>
<li>ADDED: Add support for tables in LaTeX</li>
<li>ADDED: HTML Comments appear as raw LaTeX</li>
<li>ADDED: Improved citation support in LaTeX</li>
<li>ADDED: Support \autoref{} in LaTeX</li>
<li>ADDED: Support combined options in LaTeX citations that use the &#8216;][&#8217; syntax</li>
<li>ADDED: Support language specifier in fenced code blocks</li>
<li>ADDED: Support metadata in LaTeX</li>
<li>ADDED: Update Citations test suite</li>
<li>FIXED: Escaped LaTeX characters</li>
<li>FIXED: Fix bug in URL parsing</li>
<li>FIXED: Fix bug in citation links</li>
<li>FIXED: Fix bug when no closing divider or newline at end of last table cell</li>
<li>FIXED: Fix issue printing &#8216;-&#8217;</li>
<li>FIXED: Fix scan_url test suite</li>
<li>FIXED: Get Math working in LaTeX</li>
<li>FIXED: Improve reliability or link scanner</li>
<li>FIXED: Properly add id attribute to new instances of citation only</li>
<li>FIXED: Properly handle manual labels with TOC</li>
<li>FIXED: Properly print hash characters in LaTeX</li>
<li>FIXED: Separate LaTeX verbatim and texttt character handling</li>
<li>FIXED: Update Escapes test LaTeX result</li>
<li>FIXED: Work on escaping LaTeX characters</li>
</ul></li>
<li><p>2017&#8211;02&#8211;08 &#8211; v 0.1.4a:</p>

<ul>
<li>ADDED: Add smart quote support for other languages (resolves #15)</li>
</ul></li>
<li><p>2017&#8211;02&#8211;08 &#8211; v 0.1.3a:</p>

<ul>
<li>ADDED: Add support for reference image id attributes</li>
<li>ADDED: Add support for table captions</li>
<li>ADDED: Metadata support for base header level</li>
<li>ADDED: Support distinction between 3 and 5 backticks in fenced code blocks</li>
<li>ADDED: Support Setext headers</li>
<li>FIXED: Fix issue with metadata disrupting smart quotes</li>
</ul></li>
<li><p>2017&#8211;02&#8211;07 &#8211; v 0.1.2a:</p>

<ul>
<li>&#8220;pathologic&#8221; test suite &#8211; fix handling of nested brackets, e.g.
<code>[[[[foo]]]]</code> to avoid bogging down checking for reference links that
don&#8217;t exist.</li>
<li>Table support &#8211; a single blank line separates sections of tables, so
at least two blank lines are needed between adjacent tables.</li>
<li>Definition list support</li>
<li>&#8220;fuzz testing&#8221; &#8211; stress test the parser for unexpected failures</li>
<li>Table of Contents support</li>
<li>Improved compatibility mode parsing</li>
</ul></li>
<li><p>2017&#8211;01&#8211;28 &#8211; v 0.1.1a includes a few updates:</p>

<ul>
<li>Metadata support</li>
<li>Metadata variables support</li>
<li>Extended ASCII range character checking</li>
<li>Rudimentary language translations, including German</li>
<li>Improved performance</li>
<li>Additional testing:

<ul>
<li>CriticMarkup</li>
<li>HTML Blokcs</li>
<li>Metadata/Variables</li>
<li>&#8220;pathologic&#8221; test cases from CommonMark</li>
</ul></li>
</ul></li>
</ul>

<div class="glossary">
<hr />
<ol>

<li id="gn:1">
PEG: <p>Parsing Expression Grammar <a href="https://en.wikipedia.org/wiki/Parsing_expression_grammar">https://en.wikipedia.org/wiki/Parsing_expression_grammar</a> <a href="#gnref:1" title="return to body" class="reverseglossary">&#160;&#8617;&#xfe0e;</a></p>
</li>

</ol>
</div>

</body>
</html>

